Dialog box items are arranged by setting an initial anchor control and then specifying a chain of controls relative to the first control. Layouts and group items are the only two objects that can have anchor controls. Anchor controls are set using either
SetFirstLayoutItem or
SetFirstGroupItem. The next item is placed relative to the anchor item using either
SetBelowItem or
SetRightItem. Using these calls, a chain of controls can be created with each item relative to the other. Group items are just like other items in that any control including another group can be placed to the right of or below another group.
The initial arrangement generally places items so that their left and top edges are aligned. To specify other alignments use the
AlignItemEdge call. In
AlignItemEdge you specify an edge and an alignment group. All objects in the same alignment group are aligned together.
AlignItemEdge also allows you to specify whether you want an object to shift or resize when performing the alignment.